package com.tengju.motivation.domain.shared;

/**
 * @author: 李大仙
 * @date: 2021/5/21 4:19 下午
 */
public enum SqlDominationDealerTeamNumFieldEnum {
    /**
     * 月度
     */
    DOMINATION_DEALER_TEAM_NUM_FIELD_MONTH(DateType.MONTH,
            "month_pull_level2_cnt",
            "month_pull_level3_cnt",
            "month_pull_level4_cnt"),
    /**
     * 季度
     */
    DOMINATION_DEALER_TEAM_NUM_FIELD_QUARTER(DateType.QUARTER,
            "quarter_pull_level2_cnt",
            "quarter_pull_level3_cnt",
            "quarter_pull_level4_cnt"),
    ;

    DateType dateType;
    String sqlDominationVipNumField;
    String sqlDominationVvipNumField;
    String sqlDominationSvipNumField;

    public DateType getDateType() {
        return dateType;
    }

    public String getSqlDominationVipNumField() {
        return sqlDominationVipNumField;
    }

    public String getSqlDominationVvipNumField() {
        return sqlDominationVvipNumField;
    }

    public String getSqlDominationSvipNumField() {
        return sqlDominationSvipNumField;
    }

    SqlDominationDealerTeamNumFieldEnum(DateType dateType,
                                        String sqlDominationVipNumField,
                                        String sqlDominationVvipNumField,
                                        String sqlDominationSvipNumField) {
        this.dateType = dateType;
        this.sqlDominationVipNumField = sqlDominationVipNumField;
        this.sqlDominationVvipNumField = sqlDominationVvipNumField;
        this.sqlDominationSvipNumField = sqlDominationSvipNumField;
    }

    public static SqlDominationDealerTeamNumFieldEnum getByDateType(DateType dateType) {
        for (SqlDominationDealerTeamNumFieldEnum fieldEnum : SqlDominationDealerTeamNumFieldEnum.values()) {
            if (fieldEnum.dateType.equals(dateType)) {
                return fieldEnum;
            }
        }
        return DOMINATION_DEALER_TEAM_NUM_FIELD_MONTH;
    }
}
